/*
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.androidpublisher.model;

/**
 * A single purchase option for a one-time product.
 *
 * <p> This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the Google Play Android Developer API. For a detailed
 * explanation see:
 * <a href="https://developers.google.com/api-client-library/java/google-http-java-client/json">https://developers.google.com/api-client-library/java/google-http-java-client/json</a>
 * </p>
 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class OneTimeProductPurchaseOption extends com.google.api.client.json.GenericJson {

  /**
   * A purchase option that can be bought.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private OneTimeProductBuyPurchaseOption buyOption;

  /**
   * Pricing information for any new locations Play may launch in the future. If omitted, the
   * purchase option will not be automatically available in any new locations Play may launch in the
   * future.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private OneTimeProductPurchaseOptionNewRegionsConfig newRegionsConfig;

  /**
   * Optional. List of up to 20 custom tags specified for this purchase option, and returned to the
   * app through the billing library. Offers for this purchase option will also receive these tags
   * in the billing library.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.List<OfferTag> offerTags;

  static {
    // hack to force ProGuard to consider OfferTag used, since otherwise it would be stripped out
    // see https://github.com/google/google-api-java-client/issues/543
    com.google.api.client.util.Data.nullOf(OfferTag.class);
  }

  /**
   * Required. Immutable. The unique identifier of this purchase option. Must be unique within the
   * one-time product. It must start with a number or lower-case letter, and can only contain lower-
   * case letters (a-z), numbers (0-9), and hyphens (-). The maximum length is 63 characters.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String purchaseOptionId;

  /**
   * Regional pricing and availability information for this purchase option.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.List<OneTimeProductPurchaseOptionRegionalPricingAndAvailabilityConfig> regionalPricingAndAvailabilityConfigs;

  /**
   * A purchase option that can be rented.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private OneTimeProductRentPurchaseOption rentOption;

  /**
   * Output only. The state of the purchase option, i.e., whether it's active. This field cannot be
   * changed by updating the resource. Use the dedicated endpoints instead.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String state;

  /**
   * Optional. Details about taxes and legal compliance.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private PurchaseOptionTaxAndComplianceSettings taxAndComplianceSettings;

  /**
   * A purchase option that can be bought.
   * @return value or {@code null} for none
   */
  public OneTimeProductBuyPurchaseOption getBuyOption() {
    return buyOption;
  }

  /**
   * A purchase option that can be bought.
   * @param buyOption buyOption or {@code null} for none
   */
  public OneTimeProductPurchaseOption setBuyOption(OneTimeProductBuyPurchaseOption buyOption) {
    this.buyOption = buyOption;
    return this;
  }

  /**
   * Pricing information for any new locations Play may launch in the future. If omitted, the
   * purchase option will not be automatically available in any new locations Play may launch in the
   * future.
   * @return value or {@code null} for none
   */
  public OneTimeProductPurchaseOptionNewRegionsConfig getNewRegionsConfig() {
    return newRegionsConfig;
  }

  /**
   * Pricing information for any new locations Play may launch in the future. If omitted, the
   * purchase option will not be automatically available in any new locations Play may launch in the
   * future.
   * @param newRegionsConfig newRegionsConfig or {@code null} for none
   */
  public OneTimeProductPurchaseOption setNewRegionsConfig(OneTimeProductPurchaseOptionNewRegionsConfig newRegionsConfig) {
    this.newRegionsConfig = newRegionsConfig;
    return this;
  }

  /**
   * Optional. List of up to 20 custom tags specified for this purchase option, and returned to the
   * app through the billing library. Offers for this purchase option will also receive these tags
   * in the billing library.
   * @return value or {@code null} for none
   */
  public java.util.List<OfferTag> getOfferTags() {
    return offerTags;
  }

  /**
   * Optional. List of up to 20 custom tags specified for this purchase option, and returned to the
   * app through the billing library. Offers for this purchase option will also receive these tags
   * in the billing library.
   * @param offerTags offerTags or {@code null} for none
   */
  public OneTimeProductPurchaseOption setOfferTags(java.util.List<OfferTag> offerTags) {
    this.offerTags = offerTags;
    return this;
  }

  /**
   * Required. Immutable. The unique identifier of this purchase option. Must be unique within the
   * one-time product. It must start with a number or lower-case letter, and can only contain lower-
   * case letters (a-z), numbers (0-9), and hyphens (-). The maximum length is 63 characters.
   * @return value or {@code null} for none
   */
  public java.lang.String getPurchaseOptionId() {
    return purchaseOptionId;
  }

  /**
   * Required. Immutable. The unique identifier of this purchase option. Must be unique within the
   * one-time product. It must start with a number or lower-case letter, and can only contain lower-
   * case letters (a-z), numbers (0-9), and hyphens (-). The maximum length is 63 characters.
   * @param purchaseOptionId purchaseOptionId or {@code null} for none
   */
  public OneTimeProductPurchaseOption setPurchaseOptionId(java.lang.String purchaseOptionId) {
    this.purchaseOptionId = purchaseOptionId;
    return this;
  }

  /**
   * Regional pricing and availability information for this purchase option.
   * @return value or {@code null} for none
   */
  public java.util.List<OneTimeProductPurchaseOptionRegionalPricingAndAvailabilityConfig> getRegionalPricingAndAvailabilityConfigs() {
    return regionalPricingAndAvailabilityConfigs;
  }

  /**
   * Regional pricing and availability information for this purchase option.
   * @param regionalPricingAndAvailabilityConfigs regionalPricingAndAvailabilityConfigs or {@code null} for none
   */
  public OneTimeProductPurchaseOption setRegionalPricingAndAvailabilityConfigs(java.util.List<OneTimeProductPurchaseOptionRegionalPricingAndAvailabilityConfig> regionalPricingAndAvailabilityConfigs) {
    this.regionalPricingAndAvailabilityConfigs = regionalPricingAndAvailabilityConfigs;
    return this;
  }

  /**
   * A purchase option that can be rented.
   * @return value or {@code null} for none
   */
  public OneTimeProductRentPurchaseOption getRentOption() {
    return rentOption;
  }

  /**
   * A purchase option that can be rented.
   * @param rentOption rentOption or {@code null} for none
   */
  public OneTimeProductPurchaseOption setRentOption(OneTimeProductRentPurchaseOption rentOption) {
    this.rentOption = rentOption;
    return this;
  }

  /**
   * Output only. The state of the purchase option, i.e., whether it's active. This field cannot be
   * changed by updating the resource. Use the dedicated endpoints instead.
   * @return value or {@code null} for none
   */
  public java.lang.String getState() {
    return state;
  }

  /**
   * Output only. The state of the purchase option, i.e., whether it's active. This field cannot be
   * changed by updating the resource. Use the dedicated endpoints instead.
   * @param state state or {@code null} for none
   */
  public OneTimeProductPurchaseOption setState(java.lang.String state) {
    this.state = state;
    return this;
  }

  /**
   * Optional. Details about taxes and legal compliance.
   * @return value or {@code null} for none
   */
  public PurchaseOptionTaxAndComplianceSettings getTaxAndComplianceSettings() {
    return taxAndComplianceSettings;
  }

  /**
   * Optional. Details about taxes and legal compliance.
   * @param taxAndComplianceSettings taxAndComplianceSettings or {@code null} for none
   */
  public OneTimeProductPurchaseOption setTaxAndComplianceSettings(PurchaseOptionTaxAndComplianceSettings taxAndComplianceSettings) {
    this.taxAndComplianceSettings = taxAndComplianceSettings;
    return this;
  }

  @Override
  public OneTimeProductPurchaseOption set(String fieldName, Object value) {
    return (OneTimeProductPurchaseOption) super.set(fieldName, value);
  }

  @Override
  public OneTimeProductPurchaseOption clone() {
    return (OneTimeProductPurchaseOption) super.clone();
  }

}
